Expand description
Utilities for writing SSML documents.
The root document in SSML is Speak
. Use speak()
to quickly create a document.
let doc = ssml::speak(Some("en-US"), ["Hello, world!"]);
Use Serialize
to convert SSML elements to their string XML representation, which can then be sent to your speech
synthesis service of chocie.
use ssml::Serialize;
let str = doc.serialize_to_string(&ssml::SerializeOptions::default().pretty())?;
assert_eq!(
str,
r#"<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">
Hello, world!
</speak>"#
);
Modules
- Elements exclusive to
Flavor::MicrosoftAzureCognitiveSpeechServices
(ACSS/MSTTS). - Utilities for serializing XML.
- Walk through all elements of an SSML document.
Structs
Audio
supports the insertion of recorded audio files and the insertion of other audio formats in conjunction with synthesized speech output.- A string representation of a signed amplitude offset in decibels (
dB
). - An
Element
that outputs a string of XML. - Configuration for elements that support
Serialize
. - The root element of an SSML document.
- A non-marked-up string of text for use as a spoken element.
- A time designation is a representation of a non-negative offset of time.
- The
Voice
element allows you to specify a voice or use multiple different voices in one document. - Configuration for the
Voice
element. - A utility for writing optionally formatted XML to a
Write
stream.
Enums
- Specify repeating an
Audio
element’s playback for a certain number of times, or for a determined duration. - Represents all SSML elements.
- Vendor-specific flavor of SSML. Specifying this can be used to enable compatibility checks & add additional metadata required by certain services.
Traits
- A dynamic element which can be used to implement non-standard SSML elements outside of the
ssml
crate. - Trait to support serializing SSML elements.
Functions
- Creates a new
Audio
element with an audio source URI. - Creates a new SSML document with elements.
- Creates a spoken
Text
element from a string. - Creates a new
voice
element to change the voice of a section of spoken elements.